Skip to main content

dialogData

Type

property

Summary

Specifies data to be passed to a dialog box.

Syntax

set the dialogData to <string>

Description

Use the dialogData property to pass data between a dialog box and the stack that opens the dialog box.

The dialogData can be used for any data you wish to place in it. For example, you can use it within a modal dialog stack to hold the name of the button the user clicked, the state of other options that are set in the dialog box, the contents of text fields the user filled in, and any other information. The handler that showed the dialog box can then use the information in the dialogData. The calling handler can also place information--for example, default settings--into the dialogData property, and the modal dialog stack can use that information to set up the dialog box when it opens.

Since the dialogData property is global and can be set or accessed by any stack, this method generally creates simpler code than the alternatives (such as using global variables, or passing parameters between stacks).

tip

The built-in "Answer Dialog" and "Ask Dialog" stacks, which are used by the ask and answer commands, use the dialogData property to pass data between the development environment and the dialog box. To see the scripts used for these stacks, enter one of the following statements into the message box:

    edit the script of card 1 of stack \"Answer Dialog\"
edit the script of card 1 of stack \"Ask Dialog\"

Examples

set the dialogData to "OK"
put last item of the dialogData into buttonReceived

function: stacks

glossary: script, variable, handler, property, dialog box, development environment, modal dialog box, command, caller, parameter, statement, pass

keyword: default, button, string, message box

object: stack, field

property: default

command: answer, ask, modeless, global

control structure: pass

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?